#ENTER PARAMETERS HERE
DATAFOLDER=/home/wilbur/data;
CODEFOLDER=/home/wilbur/work;
ROOTFOLDER=/home/wilbur/data/root;
T2RFOLDER=trace2root;


FILENAME=2013_07_28_3mltol+PPO_4.46Hz_500mvdiv_25mvT_80nsdiv_2.5kpts_cold

#------------------------Thresholds-------------------------#
VARIANCETHRESHOLD=0.020; #400pspt 1vdiv 1vgain
VOLTAGETHRESHOLD=0.015
#-----------------------------------------------------------#

NOISEHISTO=1; 
COUNTPEAKS=1;
CHARGEHISTO=1;
VARIANCEHISTO=0;
VARIANCECUT=0;
CUTZEROES=0;

DATANAME=_traces.bin;
HEADERNAME=_header.txt;
ROOTFILENAME=.root;
CHANNELS="ch=2";
ACHANNELS=2;
NUMTRACES=10000;

#FASTFRAME=10;
FASTFRAME=100;
MAXTIME=600000;

#RUN SCOPE PROGRAM
echo ./teksoft $DATAFOLDER/$FILENAME $CHANNELS $NUMTRACES $FASTFRAME $MAXTIME;
/home/wilbur/work/ttek/./teksoft $DATAFOLDER/$FILENAME $CHANNELS $NUMTRACES $FASTFRAME $MAXTIME;

#RUN ANALYSIS
echo;
echo RUNNING TraceToRoot;

#echo "r $DATAFOLDER/$FILENAME$DATANAME $DATAFOLDER/$FILENAME$HEADERNAME $ROOTFOLDER/$FILENAME$ROOTFILENAME $VOLTAGETHRESHOLD $NOISEHISTO $COUNTPEAKS $CHARGEHISTO $VARIANCEHISTO $VARIANCECUT $VARIANCETHRESHOLD $CUTZEROES $ACHANNELS" > args.dat
#
echo $CODEFOLDER/$T2RFOLDER/./TraceToRoot $DATAFOLDER/$FILENAME$DATANAME $DATAFOLDER/$FILENAME$HEADERNAME $ROOTFOLDER/$FILENAME$ROOTFILENAME $VOLTAGETHRESHOLD $NOISEHISTO $COUNTPEAKS $CHARGEHISTO $VARIANCEHISTO $VARIANCECUT $VARIANCETHRESHOLD $CUTZEROES $ACHANNELS;
$CODEFOLDER/$T2RFOLDER/./TraceToRoot $DATAFOLDER/$FILENAME$DATANAME $DATAFOLDER/$FILENAME$HEADERNAME $ROOTFOLDER/$FILENAME$ROOTFILENAME $VOLTAGETHRESHOLD $NOISEHISTO $COUNTPEAKS $CHARGEHISTO $VARIANCEHISTO $VARIANCECUT $VARIANCETHRESHOLD $CUTZEROES $ACHANNELS;
#gdb $CODEFOLDER/$T2RFOLDER/./TraceToRoot -command=args.dat

